fix: case court report modal ui changes #6185
Draft
+73
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What github issue is this PR for, if any?
Resolves #5888, #6165
What changed, and why?
This PR changes the modal displayed at
/case_court_reports
by constraining the width of the select options seen when the modal is opened. Currently, if an option is long enough it will overflow through the side of the modal, after these changes it is truncated with ellipses. It also now displays an error message when a user tries to generate a report without first making a selection and clears the error when a selection is made or the modal is closed. Closing the modal will also reset the selected case.How is this tested? (please write tests!) 💖💪
Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system
Screenshots please :)
Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.
Before: signed in as admin, selecting a long case option - there is no border around the option and it overflows when too long
Before: signed in as admin, trying to generate a report with no case selected. Does not tell user that selection is required, and keeps selection when modal is closed
test-vid-1.mov
After: signed in as admin, selecting a long case option - there's a border around the select element and it gets truncated with ellipses
After: signed in as admin, trying to generate report with case selected displays an error message. Making a selection clears the error. Closing the modal clears the error and also resets the selection
Screen.Recording.2025-01-24.at.12.50.35.AM.mov
After: signed in as volunteer, select border styles are consistent with admin styles and error message still appears when trying to generate report without selecting an option
Feelings gif (optional)
What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:
![alt text](https://media.giphy.com/media/1nP7ThJFes5pgXKUNf/giphy.gif)